<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
	function refresh_data(btn,dataname)
	{
		btn.disabled = true;
		btn.value = '<%:Refresh...%> ';
		murl=dataname;
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","refresh")%>',
			{ set:murl },
			function(x,rv)
			{
			var s = document.getElementById(dataname+'-status');
			if (s)
			{
				switch (rv.ret)
				{
					case 0:
						s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+"</font>";
						break;
					case 1:
						s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
						break;
					default:
						s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
						break;
				}
			}
				btn.disabled = false;
				btn.value    = '<%:Refresh Data %>';
			}
		);
		return false;
	}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>
